package com.dong.user.response;

import java.io.Serializable;

public class ResponseResult implements Serializable {

    public static final ResponseResult SUCCESS = new ResponseResult() ;
    public static ResponseResult USERNAME_PASSWORD_INVALID = new ResponseResult("1001","username or password is incorrect");
    public static ResponseResult EMAIL_OR_MOBILE_REQUIRED= new ResponseResult("1002","email or mobile  is required");
    public static ResponseResult SEND_VERIFYCODE_SUCCESS= new ResponseResult("2001","send verify code success");
    public static ResponseResult VERIFYCODE_REQUIRED= new ResponseResult("1003","verifyCode  is required");
    public static ResponseResult VERIFYCODE_INVALID = new ResponseResult("1004","verifyCode  is error");
    public static ResponseResult VERIFYCODE_SEND_ERROR= new ResponseResult("1004","verifyCode  send error");
    public static ResponseResult MOBILE_NO_ERROR= new ResponseResult("1005","input a right mobile");
    public static ResponseResult EMAIL_ERROR= new ResponseResult("1006","input a right email");

    public static ResponseResult exception(Exception e) {
        return new ResponseResult("9999",e.getMessage());
    }

    private String code;
    private String message;

    public ResponseResult() {
        this.code = "0";
        this.message = "success";
    }

    public ResponseResult(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
